# Contributor: Henrik Riomar <henrik.riomar@gmail.com>
# Maintainer: Henrik Riomar <henrik.riomar@gmail.com>
pkgname=colormake
pkgver=0.9.20170221
pkgrel=0
_sha=93dd19b5143b124208caab5e9b6d57b5e6ec02cb
pkgdesc="A simple wrapper around make to colorize the output"
url="http://bre.klaki.net/programs/colormake"
arch="noarch"
license="GPL-2.0-or-later"
checkdepends="make"
depends="bash less perl"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/pagekite/Colormake/archive/$_sha.tar.gz"
builddir="$srcdir/Colormake-$_sha"

check() {
	cd "$builddir"
	PATH=.:${PATH} ./colormake --version
}

package() {
	cd "$builddir"
	# sed must be done after check()
	sed -i 's|colormake.pl|/usr/share/colormake/&|' colormake
	install -Dm0755 colormake "$pkgdir"/usr/bin/colormake
	install -Dm0755 colormake.pl "$pkgdir"/usr/share/colormake/colormake.pl
	install -Dm0644 colormake.1 "$pkgdir"/usr/share/man/man1/colormake.1

	# symlinks
	ln -s /usr/bin/colormake "$pkgdir"/usr/bin/clmake
	ln -s /usr/bin/colormake "$pkgdir"/usr/bin/clmake-short
	ln -s /usr/bin/colormake "$pkgdir"/usr/bin/colormake-short
}

sha512sums="2f36db7e8ee3e936d709bfb31cf95451f2897c1202ea83c08cf3110067d5dcc2602e038ed1ee82ba11cfe3b095d01f918c7487efcb95a03623129f6b3509b87e  colormake-0.9.20170221.tar.gz"
